Skip to content

Split configuration and add resetPeerList for region migration#12101

Merged
OneSizeFitsQuorum merged 5 commits intoapache:region_migrationfrom
HxpSerein:split_config
Mar 5, 2024
Merged

Split configuration and add resetPeerList for region migration#12101
OneSizeFitsQuorum merged 5 commits intoapache:region_migrationfrom
HxpSerein:split_config

Conversation

@HxpSerein
Copy link
Collaborator

@HxpSerein HxpSerein commented Feb 29, 2024

Description

Split configuration and add resetPeerList for region migration, see feishu-doc for details.

@HxpSerein HxpSerein changed the base branch from master to region_migration February 29, 2024 08:27
Copy link
Collaborator

@liyuheng55555 liyuheng55555 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL~

Files.deleteIfExists(configurationPath);
Files.move(tmpConfigurationPath, configurationPath);
}
buffer = ByteBuffer.wrap(Files.readAllBytes(configurationPath));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the configuration.dat file is split, seems Files.readAllBytes(configurationPath) will cause IOException, then line 637 will catch this exception and handle it with the new getConfiguration method.
Thus, there are some other code also throw IOException. This makes the code here somewhat unclear.
image
It is hoped to use a clearer method to determine whether the current processing is a new version file or an old version file (for example, whether the CONFIGURATION_FILE_NAME file exists or not).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.

@HxpSerein HxpSerein requested a review from liyuheng55555 March 4, 2024 13:15
@HxpSerein HxpSerein changed the title Split IoTConsensus region peer configuration for region migration Split configuration and add resetPeerList for region migration Mar 4, 2024
Copy link
Collaborator

@liyuheng55555 liyuheng55555 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@OneSizeFitsQuorum OneSizeFitsQuorum merged commit e6d0e4d into apache:region_migration Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants